home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Pesquisa Dirigida
/
Pesquisa Dirigida.iso
/
JOGOS
/
parking.swf
/
scripts
/
soundcontrol.as
< prev
next >
Wrap
Text File
|
2005-01-18
|
1KB
|
49 lines
function SoundControl()
{
this.swapDepths(10);
this.silent_mc._visible = false;
_root.control_sound = new Sound(_root);
this.muted = false;
this.fadein = false;
this.onRelease = this.clicked;
}
SoundControl.prototype = new MovieClip();
SoundControl.prototype.clicked = function()
{
if(this.muted)
{
this.unmuteAllSounds();
}
else
{
this.muteAllSounds();
}
};
SoundControl.prototype.muteAllSounds = function()
{
if(this.fadein)
{
delete this.onEnterFrame;
this.fadein = false;
}
_root.control_sound.setVolume(0);
this.silent_mc._visible = true;
this.muted = true;
};
SoundControl.prototype.unmuteAllSounds = function()
{
this.fadein = true;
this.silent_mc._visible = false;
this.muted = false;
this.onEnterFrame = function()
{
_root.control_sound.setVolume(_root.control_sound.getVolume() + 10);
if(_root.control_sound.getVolume() >= 100)
{
this.fadein = false;
delete this.onEnterFrame;
}
};
};
Object.registerClass("soundcontrol",SoundControl);